page.insert_html :top, active_scaffold_tbody_id, :partial => 'list_record', :locals => {:record => @record}
page << "ActiveScaffold.stripe($('#{active_scaffold_tbody_id}'))"
page << "ActiveScaffold.hide_empty_message('#{active_scaffold_tbody_id}','#{empty_message_id}');"
page << "ActiveScaffold.increment_record_count('#{active_scaffold_id}');"

if (form_stays_open = true)
  # why not just re-render the form? that wouldn't utilize a possible do_new override which sets default values.
  page << "$('#{element_form_id}').reset()"
  page.replace_html element_messages_id(:action => :add_existing), :partial => 'form_messages'
  # have to delay the focus, because there's no "firstElement" in prototype until at least one element is not disabled
  page.delay 0.1 do
    page << "Form.focusFirstElement('#{element_form_id}');"
  end
else
  page << "$$('##{element_form_id(:action => :new_existing)} a.cancel').first().link.close();"
end